const menuField = {
  children: 'childs',
  level: 'level',
  menuEnUs: 'menuNameEnUs',
  menuIcon: 'menuIcon',
  menuType: 'menuType',
  menuZhCn: 'menuNameZhCn',
  menuId: 'id',
  menuCode: 'code',
  parentIds: 'parentIds',
  path: 'menuUrl',
  remark: 'remark',
  serviceId: 'serviceId'
}

export const getMenuValue = (menu = {}, alias = '') => {
  return menuField[alias].split('.').reduce((value, key) => value && value[key], menu)
}